package nicg.st.util;

import nicg.st.entity.SingleUnit;

import com.alibaba.fastjson.JSON;
import com.bingqi2.Dtml;
import com.bingqi2.Dtml.getSingleUnitJsonResult;

public class DTMLHelper {
	
	public static String getLocalIp(){
		Dtml dtml = new Dtml();
		dtml.init();
		String currentId = dtml.getUnitId();
		getSingleUnitJsonResult res = dtml.getSingleUnitJson(currentId);
		String json = res.json;
		SingleUnit singleUnit = JSON.parseObject(json,SingleUnit.class);
		return singleUnit.getUnit().getCommElement().getIP();
	}
}
